package document.apps;

import antlr.RecognitionException;
import antlr.TokenStreamException;
import document.model.Book;
import metamodel.ClassNode;
import metamodel.TraversalUtils;
import metamodel.misc.GraphViz;

import java.io.IOException;
import java.io.StringWriter;
import java.io.OutputStreamWriter;

/**
 * User: fleipold
 * Date: 28-Nov-2007
 * Time: 22:48:10
 */
public class ExampleToString {
    private final  ClassNode traversalModel;

    public ExampleToString() throws TokenStreamException, RecognitionException, IOException {
         traversalModel = TraversalUtils.parse(getClass().getResourceAsStream("full.trv"));
        Book book = Book.buildExample();
        TraversalUtils.print(traversalModel, book, new OutputStreamWriter(System.out));
        
    }

    public static void main(String[] args) throws TokenStreamException, RecognitionException, IOException {
        new ExampleToString();
    }

}